﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Specification
{
    public abstract class Disjunction<T> : CompositeSpecification<T>
    {
        public Disjunction()
        {
            this._Specifications = new List<ISpecification<T>>();
        }
        public Disjunction(IEnumerable<ISpecification<T>> Specifications)
        {
            this._Specifications = Specifications;
        }
        public override bool isSatisfiedBy(T objekt)
        {
            foreach (ISpecification<T> specification in this._Specifications)
                if (specification.isSatisfiedBy(objekt))
                    return true;
            return false;
        }
    }
}
